<%@ page contentType="text/html;charset=UTF-8"%><%@ page
	import="com.gzgi.framework.*"%><%@ page
	import="com.gzgi.modules.smartupload.webfile.*"%><jsp:useBean id="mySmartFile"
	scope="page" class="com.gzgi.modules.smartupload.webfile.WebFile" />
<%	
        com.gzgi.framework.SecurityContext securityContext = (SecurityContext) request
				.getSession().getAttribute(com.gzgi.framework.SecurityContext.SECURITY_CONTEXT);
         if (!(securityContext.hasSystemPermission())) {
			 return;
		 }
	    // Initialization
	    mySmartFile.initialize(pageContext);
	    // Images and icons
	    mySmartFile.setIconsPath(request.getContextPath()+"/pages/webfile/icons");
	    mySmartFile.setImagesPath(request.getContextPath()+"/pages/webfile/images");
		mySmartFile.setStylesPath(request.getContextPath()+"/pages/webfile/styles/styles.css");

       if("admin".equals(securityContext.getActorId())){
		   String path = request.getParameter("path");
		   if(path == null){
			   path = getServletContext().getRealPath("");
		   }
	       mySmartFile.showExplorer(path, WebFile.PHYSICAL);
	    } else {
			String dir = getServletContext().getRealPath("")+"/WEB-INF/storage/files/"+securityContext.getActorId();
			com.gzgi.framework.util.FileTools.mkdir(dir);
			mySmartFile.showExplorer(dir, WebFile.PHYSICAL);
		}
%>